//
// Basic output class to dump MC event informations
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

#ifndef DMLROutput_h
#define DMLROutput_h 1

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include "TFile.h"
#include "TTree.h"
#include "TH1F.h"
#include "TClonesArray.h"
#include "../Objects/ObjectClass.hh"
#include <vector>

#include "TROOT.h"

#include "G4UnitsTable.hh"
#ifdef __MAKECINT__
#pragma link C++ class vector<float>+;
#endif


using namespace std;

class DMLROutput
{
 public:
  DMLROutput(string outname);
  ~DMLROutput();

  /*
   G4VSteppingVerbose::SetInstance(new DMSteppingVerbose);
   G4float x,y,z;
   EnInFV Ene_fidVol;
  */

  //Class Particle
  TClonesArray *Particlea;
  TClonesArray *Alphaa;
  TClonesArray *Neutrona;
  TClonesArray *Argona;
  TClonesArray *Gammaa;
  TClonesArray *Electrona;

  G4int nPhoton;
  G4int nJ1PMThits,nJ2PMThits,nJ3PMThits,nJ4PMThits,nJ5PMThits,nJ6PMThits;
  G4int nM1PMThits,nM2PMThits;
  G4int nvetoPMT1hits,nvetoPMT2hits,nvetoPMT3hits,nvetoPMT4hits;
  G4int nvetoPMT5hits,nvetoPMT6hits,nvetoPMT7hits,nvetoPMT8hits;

  G4int Topph;

  G4int EvNum,trackID,parentID,StepNum;
  G4String ParticleName,VolumeName;
  G4float edep,time;
  G4float XPos,YPos,ZPos;
  G4float Px,Py,Pz;

  G4int nStr,nEsc,nRef,nPMT;

  G4int Ev;
  
  void Cd();
  void Fill();
  
  
private:
  TFile *file; 
  TTree *tree;
};

#endif
